
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:h="http://java.sun.com/jsf/html"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/templates/StaffTemplateUnauthenticated.xhtml">
    
    <ui:define name="localization">
        <h:selectOneMenu id="selectedLocale" value="#{indexManagedBean.selectedLocale}">
            <f:selectItems value="#{enumSelectedLocale.listItems}" />
                                
            <p:ajax update="panel
                            staffLoginUsernameLabel
                            staffLoginPasswordLabel 
                            remember_me
                            remember
                            forgot_password
                            loginLoginButton" 
                    listener="#{indexManagedBean.selectedLocaleValueChangeListener}" />
        </h:selectOneMenu>
    </ui:define>
    <ui:define name="content"> 

        <!-- panel for dividing web page into sections -->
        <p:panel id="panel" header="#{bundle['login.staff.panel']}" style="margin-bottom:10px;">  
            <p:messages />

            <h:panelGrid columns="3" cellpadding="5">
                <h:outputText id="staffLoginUsernameLabel" value ="#{bundle['staff.username.label']}" />
                <p:inputText id="username" required="true" label="username" requiredMessage="#{bundle['login.username.required']}" value="#{staffLoginManagedBean.username}" />
                <p:message for="username"/>

                <h:outputLabel id="staffLoginPasswordLabel" value="#{bundle['login.password.label']}" />
                <p:password id="password" feedback="false" minLength="6" required="true" label="password" requiredMessage="#{bundle['login.password.required']}" value="#{staffLoginManagedBean.password}" />
                <p:message for="password"/>
            </h:panelGrid>
            <br/>
            <h:panelGrid columns="1" >
                <h:column>
                    <h:selectBooleanCheckbox id="remember_me"/> <h:outputLabel id="remember" value="#{bundle['rememberme.label']}"/>
                </h:column>
                <h:commandLink id="forgot_password" value ="#{bundle['forgotpassword.label']}" action="#{pageRedirectorBean.goStaffForgotPassword}" immediate="true"/>
            </h:panelGrid>
            <br/>
            <p:commandButton id="loginLoginButton" value="#{bundle['login.login.button']}" update="panel" actionListener="#{staffLoginManagedBean.doLogin}"/>
        </p:panel> 
    </ui:define>
</ui:composition>
